<!DOCTYPE html> 
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
    contentType="text/html;charset=utf-8"%>
<html>
<head>
<title>资源管理-统计信息</title>
<jsp:include page="/common/head.jsp"></jsp:include> 
<style>
   .sys-title {
        border-bottom: 1px dotted #dadada;
        padding: 5px;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 10px;
   }
</style>   
</head>
<body class="iframe-page">
  
   <div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>行政区划管理</span>
        </div>
    </div>
    <div class="page-title-border"></div>
 </div>
  
  <div class="distance-top" id="list"> 
  </div>
  <div class="callout distance-top">
    <h4>操作说明</h4>
    <p>1、点击左侧相应节点可查资源详细信息</p>
    <p>2、在相应节点右键可进行节点的添加、修改、删除操作</p>
    <p>3、删除节点时会将其下所有子节点一并删除,请谨慎操作</p>
  </div>
  <script>
     function addItem(title, val, index){
        var iconColor = new Array("red","blue","purple","green","red","blue","purple","green","red","blue","purple","green");
        var iconStyle = new Array("icon-home","icon-app","icon-list-li","icon-attachment",
        		"icon-home","icon-app","icon-list-li", "icon-attachment","icon-app","icon-list-li","icon-attachment","icon-home");
        
        $topDiv = $("<div>").addClass("figure");
        $icoDiv = $("<div>").addClass("figure-icon").addClass(iconColor[index]).append($("<i>").addClass("icon").addClass(iconStyle[index]));
        $contentDiv = $("<div>").addClass("figure-content");
        $contentDiv.append($("<div>").addClass("figure-num").html(val));
        $contentDiv.append($("<div>").addClass("figure-text").html(title));
        $contentDiv.append($("<div>").addClass("figure-angel")); 
       $("#list").append($topDiv.append($icoDiv).append($contentDiv));
     }
  
     $(function() {
         $.sajax({
             url: basePath + '/sys/region/stat',
             onLoadSuccess: function(data){
                var arr = data.data;
                for (var i = 0; i < arr.length; i++) {
                	addItem(arr[i].name,arr[i].count,i);
                }
                $("#list").append($("<div>").addClass("clear"));
             }
         });
     });
  </script>  
</body>
</html>
